<?php declare(strict_types=1);
/**
 * @author      xianganyall <xianganyall@gmail.com>
 * @copyright   2023-2025 owner
 **/

namespace Srv\Conf\ConfModel;

use Srv\Libs\ConfModel\ConfAbstract;

final class PayWeChatConf extends ConfAbstract
{
    public const PREFIX                         = 'PAYWX.';     // 配置前缀[必定点结尾]
    private string $groupName                   = '';           // 分组名
    protected string $logPath                   = '';           // 日志路径
    protected string $mchId                     = '';           // mchId
    protected string $mchName                   = '';           // mchName
    protected string $appId                     = '';           // appId
    protected string $appKey                    = '';           // appKey
    protected int $expireTime                   = 0;            // 订单支付有效时长[秒]
    protected string $notifyUrl                 = '';           // notifyUrl
    protected string $apiClientCertFile         = '';           // apiClientCertFile
    protected string $apiClientKeyFile          = '';           // apiClientKeyFile

    /**
     * @param array $confData
     * @param string $groupName
     */
    public function __construct(array $confData, string $groupName)
    {
        $this->init($confData);
        $this->groupName = $groupName;
    }

    /**
     * @return string
     */
    public function getGroupName(): string
    {
        return $this->groupName;
    }

    /**
     * @return string
     */
    public function getLogPath(): string
    {
        return $this->logPath;
    }

    /**
     * @return string
     */
    public function getMchId(): string
    {
        return $this->mchId;
    }

    /**
     * @return string
     */
    public function getMchName(): string
    {
        return $this->mchName;
    }

    /**
     * @return string
     */
    public function getAppId(): string
    {
        return $this->appId;
    }

    /**
     * @return string
     */
    public function getAppKey(): string
    {
        return $this->appKey;
    }

    /**
     * @return int
     */
    public function getExpireTime(): int
    {
        return $this->expireTime;
    }

    /**
     * @return string
     */
    public function getNotifyUrl(): string
    {
        return $this->notifyUrl;
    }

    /**
     * @return string
     */
    public function getApiClientCertFile(): string
    {
        return $this->apiClientCertFile;
    }

    /**
     * @return string
     */
    public function getApiClientKeyFile(): string
    {
        return $this->apiClientKeyFile;
    }
}